<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
	<ui:composition template="../template/commonLayoutFull.xhtml">
		<ui:define name="content">
			<h:panelGrid style="height: 100%; width: 100%;">

				<p:fieldset legend="Backup e Monitorações" style="height:100%;" toggleable="true"
					toggleSpeed="">

					<!-- Cadastro de Demanda | Histórico | Parametrização: MODAL -->
					<p:dialog id="dgCadastro" header="Cadastro de Backup e Monitorações para ambiente"
						widgetVar="modalCadastro" modal="true" height="450"
						appendToBody="true">
								<h:form>
									<h:panelGrid  columns="4" cellpadding="5" id="pnCadBackupMonit">

										<p:row>
											<p:column>
												<p:outputLabel value="Ambiente: " />
												<h:selectOneMenu
													value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.ambiente.id}">
													<f:selectItem itemLabel="Selecione" itemValue="0" />
													<f:selectItems value="#{backupMonitoracaoAmbienteBean.ambientes.itens}" />
												</h:selectOneMenu>
											</p:column>
										</p:row>
										
										<br />
										
										<p:row>
											<p:column>
												<p:outputLabel value="Tipo de revisão: " />
												<h:selectOneMenu
													value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.tipoRevisao.id}">
													<f:selectItem itemLabel="Selecione" itemValue="0" />
													<f:selectItems value="#{backupMonitoracaoAmbienteBean.tipos.itens}" />
												</h:selectOneMenu>
											</p:column>
										</p:row>
										
										<br />

										<p:row>
											<p:column>
												<p:outputLabel value="Data de inicio: " />
												<p:calendar
													value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.dataInicioRevisao}"
													showOn="button" />
											</p:column>
										</p:row>

										<br />
										
										<p:row>
											<p:column>
												<p:outputLabel value="Data de termino: " />
												<p:calendar
													value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.dataTerminoRevisao}"
													showOn="button" />
											</p:column>
										</p:row>

										<br />
										
										<p:row>
											<p:column>
												<p:outputLabel value="Problema encontrado? : " />
												<h:selectOneMenu
													value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.isProblema}">
													<f:selectItem itemLabel="Não" itemValue="0" />
													<f:selectItem itemLabel="Sim" itemValue="1" />
												</h:selectOneMenu>
											</p:column>
										</p:row>


										<br />
										
										<p:row>
											<p:column>
												<p:outputLabel value="Publico: " />
												<h:selectOneMenu
													value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.publico}">
													<f:selectItem itemLabel="Não" itemValue="0" />
													<f:selectItem itemLabel="Sim" itemValue="1" />
												</h:selectOneMenu>
											</p:column>
										</p:row>


										<br />
										
										<p:row>
											<p:column>
												<p:outputLabel value="Descrição do problema : " />
												<br/>
												<p:inputTextarea rows="4" cols="50" maxlength="250" autoResize="false" value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.descricaoProblema}"/> 
											</p:column>
										</p:row>
										
										<br />
										
										<p:row>
											<p:column>
												<p:outputLabel value="Ações tomadas : " />
												<br/>
												<p:inputTextarea rows="4" cols="50" maxlength="250" autoResize="false" value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.detalhamentoAcao}"/> 
											</p:column>
										</p:row>
										
										<br />
										
										<p:row>
											<p:column>
												<p:outputLabel value="Evidencias :" />
												<br/>
												<p:inputTextarea rows="4" cols="50" maxlength="250" autoResize="false" value="#{backupMonitoracaoAmbienteBean.cadastroBackupMonitoracaoAmbiente.backupMonitoracao.evidencias}"/> 
											</p:column>
										</p:row>
										
										<br />

									</h:panelGrid>
									<p:separator />
									<p:commandButton id="salvarBackupMonit" value="Salvar"
										action="#{backupMonitAmbienteBean.salvarBackupMonitoracao}" />
								</h:form>
					</p:dialog>

					<!-- Filtro de Pesquisa de Melhoria -->

					<h:form>
						<p:fieldset legend="Filtros" style="height:70%;" toggleable="true"
							toggleSpeed="">
							<h:panelGrid columns="4" cellpadding="5">
								<p:outputLabel value="Data de inicio: "/>
								<p:calendar
									value="#{backupMonitoracaoAmbienteBean.consultaBackupMonitoracaoAmbiente.dtInicioRevisaoIni}"
									showOn="button" />
								<p:outputLabel value="até:" />
								<p:calendar
									value="#{backupMonitoracaoAmbienteBean.consultaBackupMonitoracaoAmbiente.dtInicioRevisaoFin}"
									showOn="button" />
								<p:outputLabel value="Data de Termino: "/>
								<p:calendar
									value="#{backupMonitoracaoAmbienteBean.consultaBackupMonitoracaoAmbiente.dtTerminoRevisaoIni}"
									showOn="button" />
								<p:outputLabel value="até:" />
								<p:calendar
									value="#{backupMonitoracaoAmbienteBean.consultaBackupMonitoracaoAmbiente.dtTerminoRevisaoFin}"
									showOn="button" />
								<p:outputLabel value="Tipo de revisão: " />
								<h:selectOneMenu
									value="#{backupMonitoracaoAmbienteBean.consultaBackupMonitoracaoAmbiente.idTipoRevisao}">
									<f:selectItem itemLabel="Selecione" itemValue="0" />
									<f:selectItems value="#{backupMonitoracaoAmbienteBean.tipos.itens}" />
								</h:selectOneMenu>
								<p:outputLabel value="Ambiente: " />
								<h:selectOneMenu value="#{backupMonitoracaoAmbienteBean.consultaBackupMonitoracaoAmbiente.idAmbiente}">
									<f:selectItem itemLabel="Selecione" itemValue="0" />
									<f:selectItems value="#{backupMonitoracaoAmbienteBean.ambientes.itens}" />
								</h:selectOneMenu>
							</h:panelGrid>

							<br />
							<br />

							<p:commandButton id="pesquisarBackupMonit" value="Pesquisar"
								action="#{backupMonitoracaoAmbienteBean.pesquisarBackupMonitoracao}" />
						</p:fieldset>
						<br />
						<br />

						<p:separator />
						<br />
						<p:commandButton id="modalDialogButton" value="Incluir"
							onclick="modalCadastro.show();" type="button" />
						<br />
						<br />
						<p:separator />

						<!-- Lista de Demanda: GRID -->
						<p:dataTable id="tableBackupMonit" var="backupMonit"
							value="#{backupMonitoracaoAmbienteBean.backupsMonitoracoes}" paginator="true" rows="20"
							paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
							rowsPerPageTemplate="5,10,15" style="" scrollable="true">
							<f:facet name="header">  
					            Backup e Monitorações  
					        </f:facet>
							<p:column sortBy="#{backupMonit.id}" headerText="ID">
								<h:outputText value="#{backupMonit.id}" />
							</p:column>
							<p:column sortBy="#{backupMonit.ambiente.nome}" headerText="Ambiente">
								<h:outputText value="#{backupMonit.ambiente.nome}" />
							</p:column>
							<p:column sortBy="#{backupMonit.dataInicioRevisao}" headerText="Data Inicio">
								<h:outputText value="#{backupMonit.dataInicioRevisao}" />
							</p:column>
							<p:column sortBy="#{backupMonit.dataTerminoRevisao}" headerText="Data Termino">
								<h:outputText value="#{backupMonit.dataTerminoRevisao}" />
							</p:column>
							<p:column sortBy="#{backupMonit.isProblema}"
								headerText="Problema encontrado ?">
								<h:outputText value="#{backupMonit.isProblema}" />
							</p:column>
							<p:column sortBy="#{backupMonit.descricaoProblema}" headerText="Problemas encontrados">
								<h:outputText value="#{backupMonit.descricaoProblema}" />
							</p:column>
							<p:column sortBy="#{backupMonit.detalhamentoAcao}"
								headerText="Ação tomada">
								<h:outputText value="#{backupMonit.detalhamentoAcao}" />
							</p:column>
						</p:dataTable>

						<!-- Export em Arquivo -->
						<h:panelGrid width="100%" style="text-align:left;"
							collapsible="true" gutter="0">
							<p:separator />
							<p:outputLabel value="Exportar em Arquivo:">
								<h:commandLink>
									<img src="#{request.contextPath}/images/xls.png" height="32"
										width="32" />
									<p:dataExporter type="xls" target="tableBackupMonit"
										fileName="riscos" />
								</h:commandLink>
								<h:commandLink>
									<img src="#{request.contextPath}/images/pdf.png" height="32"
										width="32" />
									<p:dataExporter type="pdf" target="tableBackupMonit"
										fileName="riscos" />
								</h:commandLink>
								<h:commandLink>
									<img src="#{request.contextPath}/images/csv.png" height="32"
										width="32" />
									<p:dataExporter type="csv" target="tableBackupMonit"
										fileName="riscos" />
								</h:commandLink>
								<h:commandLink>
									<img src="#{request.contextPath}/images/xml.png" height="32"
										width="32" />
									<p:dataExporter type="xml" target="tableBackupMonit"
										fileName="riscos" />
								</h:commandLink>
							</p:outputLabel>
						</h:panelGrid>
					</h:form>
				</p:fieldset>
			</h:panelGrid>
		</ui:define>
	</ui:composition>
</h:body>
</html>